using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using WeatherMcpServer.Data.Entities;

namespace WeatherMcpServer.Services.Weather;

/// <summary>
/// 天气数据源提供器抽象：用于接入多个外部天气服务。
/// 注意：该接口为扩展点，不改变现有 WeatherTool 行为。
/// </summary>
public interface IWeatherProvider
{
    /// <summary>
    /// 获取指定坐标和天偏移的天气概要信息。
    /// dayOffset: 0=今天, 1=明天, 2=后天。
    /// </summary>
    Task<ProviderForecast?> GetForecastAsync(double latitude, double longitude, int dayOffset = 0, CancellationToken ct = default);
}

/// <summary>
/// 统一的提供器返回结构，便于多源融合。
/// </summary>
public sealed record ProviderForecast(
    string? RegionCode,
    string? RegionName,
    double? TemperatureMax,
    double? TemperatureMin,
    double? RainMm,
    double? WindLevel,
    IReadOnlyList<WeatherType>? Types
);
